package cn.source.scontent.service.impl;

import java.util.List;
import cn.source.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.source.scontent.mapper.SContentMapper;
import cn.source.scontent.domain.SContent;
import cn.source.scontent.service.ISContentService;

/**
 * scontentService业务层处理
 * 
 * @author xuhao
 * @date 2023-12-19
 */
@Service
public class SContentServiceImpl implements ISContentService 
{
    @Autowired
    private SContentMapper sContentMapper;

    /**
     * 查询scontent
     * 
     * @param iId scontent主键
     * @return scontent
     */
    @Override
    public SContent selectSContentByIId(Long iId)
    {
        return sContentMapper.selectSContentByIId(iId);
    }

    /**
     * 查询scontent列表
     * 
     * @param sContent scontent
     * @return scontent
     */
    @Override
    public List<SContent> selectSContentList(SContent sContent)
    {
        return sContentMapper.selectSContentList(sContent);
    }

    /**
     * 新增scontent
     * 
     * @param sContent scontent
     * @return 结果
     */
    @Override
    public int insertSContent(SContent sContent)
    {
        sContent.setCreateTime(DateUtils.getNowDate());
        return sContentMapper.insertSContent(sContent);
    }

    /**
     * 修改scontent
     * 
     * @param sContent scontent
     * @return 结果
     */
    @Override
    public int updateSContent(SContent sContent)
    {
        sContent.setUpdateTime(DateUtils.getNowDate());
        return sContentMapper.updateSContent(sContent);
    }

    /**
     * 批量删除scontent
     * 
     * @param iIds 需要删除的scontent主键
     * @return 结果
     */
    @Override
    public int deleteSContentByIIds(Long[] iIds)
    {
        return sContentMapper.deleteSContentByIIds(iIds);
    }

    /**
     * 删除scontent信息
     * 
     * @param iId scontent主键
     * @return 结果
     */
    @Override
    public int deleteSContentByIId(Long iId)
    {
        return sContentMapper.deleteSContentByIId(iId);
    }
}
